const Card = (argv: any) => {
    const size = argv.size == 'small' ? 'ant-card-small' : ''
    const border = argv.bordered ? 'ant-card-bordered' : ''
    let header = null
    if (argv.title || argv.extra) {
        header = (
            <div className='ant-card-head'>
                <div className='ant-card-head-wrapper'>
                    <div className='ant-card-head-title'>{argv.title}</div>
                    <div className='ant-card-extra'>{argv.extra}</div>
                </div>
            </div>
        )
    }
    return (
        <div className={`ant-card ${border} ${size} ${argv.className}`} style={argv.style}>
            {header}
            <div className='ant-card-body'>{argv.children}</div>
        </div>
    )
}

Card.defaultProps = {
    bordered: true
}

export default Card
